﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using PersonaLibrary.PrintReports;
using PersonaLibrary.PrintViewModel.Model;
using PersonaLibrary.View;
using PersonaLibrary.ViewModel.PrintViewModel.Model;

namespace PersonaLibrary.ViewModel.PrintViewModel
{
	internal sealed class BithdayProperty : PrintChildVM, ITemplateProperties
	{
		private RelayCommand _applyProperty;
		public SerializeProperty Property;

		public BithdayProperty()
		{
			Property = new SerializeProperty {TableHeaderInAll = false};
		}

		public List<Column> Columns
		{
			set { Property.Columns = value; }
			get { return Property.Columns; }
		}

		public bool TableHeaderInAll
		{
			set { Property.TableHeaderInAll = value; }
			get { return Property.TableHeaderInAll; }
		}

		public string ReportHeader
		{
			set { Property.ReportHeader = value; }
			get { return Property.ReportHeader; }
		}

		public bool ReportHeaderInAll
		{
			set { Property.ReportHeaderInAll = value; }
			get { return Property.ReportHeaderInAll; }
		}

		public bool IsWindowOpened
		{
			get { throw new NotImplementedException(); }
		}

		public IView View
		{
			get { throw new NotImplementedException(); }
		}

		public RelayCommand ApplyProperty 
		{ 
			get
			{
				if (_applyProperty == null)
					_applyProperty = new RelayCommand(x => ProperiesApply(), x => true);
				return _applyProperty;
			}
		}

		public event Action ProperiesApply = delegate { };
		
		[Serializable]
		public class SerializeProperty
		{
			public List<Column> Columns { set; get; }

			public bool TableHeaderInAll { set; get; }

			public string ReportHeader { set; get; }

			public bool ReportHeaderInAll { set; get; }
		}
	}
}
